<%- include('./layout/header.ejs') %>
<h1>文章列表</h1>
<div class="list-group">
    <% article.forEach(item => { %>
    <a href="#" class="list-group-item">
        <%= item.title%>
        <span class="badge" style="background-color: #5bc0de;">发表时间:
            <%= item.ctime%></span>
        <span class="badge" style="background-color: #f0ad4e;">作者昵称:
            <%= item.nickname%></span>
    </a>
    <% })%>
</div>

<nav aria-label="Page navigation">
    <ul class="pagination">
        <li class="<%= nowpage -1=== 0 ? 'disabled' :'' %>">
            <<%= nowpage -1=== 0 ? 'span' :'a' %> href="?page=<%= nowpage-1 %>" aria-label="Previous">
                <span aria-hidden="true">&laquo;</span>
            </<%= nowpage -1=== 0 ? 'span' :'a' %>>
        </li>
        <% for(var i = 0 ; i< totalpage ; i++) { %>
        <li class="<%= nowpage ===(i+1) ? 'active' : '' %>"><a href="?page=<%= i+1 %>"><%= i+1 %></a></li>
        <% } %>
        <li class="<%= nowpage + 1 > totalpage ? 'disabled' :'' %>">
            <<%= nowpage+1 > totalpage ? 'span' : 'a' %> href="?page=<%= nowpage+1 %>" aria-label="Next">
                <span aria-hidden="true">&raquo;</span>
            </<%= nowpage+1 > totalpage ? 'span' : 'a' %>>
        </li>
    </ul>
</nav>
<%- include('./layout/footer.ejs') %>